import axios from 'axios'

const contextPath = 'json/data/', mapPath = 'json/map/'

axios.interceptors.response.use(response => {
  //直接返回，作为下一个成功结果的回调
  return response.data
}, error => {

})

export const getSellerData = () => {
  return axios({
    url: contextPath + 'seller.json',
    method: 'get'
  })
}

export const getTrendData = () => {
  return axios({
    url: contextPath + 'trend.json',
    method: 'get'
  })
}

export const getMapData = (url) => {
  return axios({
    url: mapPath + url + '.json',
    method: 'get'
  })
}

export const getScatterData = () => {
  return axios({
    url: contextPath + 'map.json',
    method: 'get'
  })
}

export const getRankData = () => {
  return axios({
    url: contextPath + 'rank.json',
    method: 'get'
  })
}
export const getHotData = () => {
  return axios({
    url: contextPath + 'hotproduct.json',
    method: 'get'
  })
}